<template>
  <el-table :data="tableData" style="width: 100%">
    <el-table-column fixed prop="date" label="Date" width="150" />
    <el-table-column prop="name" label="Name" width="120" />
    <el-table-column prop="state" label="State" width="120" />
    <el-table-column prop="city" label="City" width="120" />
    <el-table-column prop="address" label="Address" width="600" />
    <el-table-column prop="zip" label="Zip" width="120" />
    <el-table-column fixed="right" label="Operations" min-width="120">
      <template #default>
        <el-button link type="primary" size="small" @click="handleClick">
          编辑
        </el-button>
        <el-button link type="primary" size="small">删除</el-button>
      </template>
    </el-table-column>
  </el-table>
</template>

<script lang="ts" setup>
import {onMounted, ref} from 'vue'
import { getUserList } from '../api/userApi'
const handleClick = () => {
  console.log('click')
}
const tableData = ref([]);
const requestUserInfoList =  async()=>{
    const result = await getUserList();
    console.log(result)
    if(result.code === 200){
      tableData.value = result.data
    }
}
onMounted(requestUserInfoList);

</script>